package com.example.streamconsumerserver1090;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 温伟雄
 * @Date: 2021/10/13/15:44
 * @Description:
 */
@Component
//绑定消息接口
@EnableBinding(value = {StreamClient.class})
public class StreamConsumer {

    private Logger logger = LoggerFactory.getLogger(StreamConsumer .class);

    @StreamListener(StreamClient.INPUT)
    public void receive(String message) {
        logger.info("收到消息: {}", message);
    }

}
